From: Jan Beulich Date: Thu, 26 Mar 2015 10:18:28 +0000 (+0100) Subject: x86: don't change affinity with interrupt unmasked X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3522 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1aeb1156fa;p=xen.git x86: don't change affinity with interrupt unmasked With ->startup unmasking the IRQ, setting the affinity afterwards without masking the IRQ again is invalid namely for MSI (address and data can't be updated atomically and may - at least for MSI-X - be cached while unmasked). Signed-off-by: Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 786d1fc7c8..b359940fef 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1608,12 +1608,13 @@ int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share) init_timer(&action->eoi_timer, irq_guest_eoi_timer_fn, desc, 0); desc->status |= IRQ_GUEST; - desc->status &= ~IRQ_DISABLED; - desc->handler->startup(desc); /* Attempt to bind the interrupt target to the correct CPU. */ if ( !opt_noirqbalance && (desc->handler->set_affinity != NULL) ) desc->handler->set_affinity(desc, cpumask_of(v->processor)); + + desc->status &= ~IRQ_DISABLED; + desc->handler->startup(desc); } else if ( !will_share || !action->shareable ) {